<?php

if(preg_match("/uid\:\s+'([^<>]*)'\,\s+name\:\s+'([^<>]*)'\,\s+avatar\:\s+'([^<>]*)'\,\s+openUrl\:\s+'([^<>]*)'\,/Uisx",$this->ytempnr,$nn)){
    $addreturn['zmt']['zmt']="头条号";
    $addreturn['zmt']['zmthao']=$nn[2];
    $addreturn['zmt']['zwmc']=$nn[2];
    $addreturn['zmt']['zmthaoyingwen']=$nn[1];
    $addreturn['zmt']['avatar']='https:'.$nn[3];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthaoyingwen']}/";
    $nr=file_get_contents($addreturn['zmt']['homeurl']);
    preg_match("/mediaId\:\s+'([0-9]+)',/Uisx",$nr,$nn);
    $media_id=$nn[1];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthaoyingwen']}/#mid={$media_id}";
    //$addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/article/?page_type=1&user_id={$addreturn['zmt']['zmthaoyingwen']}&max_behot_time=0&count=20&_signature={$addreturn['zmt']['signature']}";
    //$addreturn['zmt']['homeurl']="https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_article&visited_uid={$addreturn['zmt']['zmthao']}&stream_api_version=82&request_source=1&offset=0&user_id={$addreturn['zmt']['zmthao']}&media_id={$media_id}";
    $addreturn['zmt']['datasourceurl']="https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_all&visited_uid={$addreturn['zmt']['zmthaoyingwen']}&stream_api_version=82&request_source=1&offset=0&user_id={$addreturn['zmt']['zmthaoyingwen']}&media_id={$media_id}";
    $addreturn['zmt']['addreturn']=json_encode($addreturn);    $addreturn['zmt']['addreturn']=json_encode($addreturn);
}

if(preg_match("/mediaInfo\:\s+\{\s+name\:\s+'([^<>]*)'\,\s+avatarUrl\:\s+'([^<>]*)'\,\s+openUrl\:\s+'([^<>]*)'\,\s+user_id\:\s+'([^<>]*)'\,/Uisx",$this->ytempnr,$nn)){
    $addreturn['zmt']['zmt']="头条号";
    $addreturn['zmt']['zmthao']=$nn[1];
    $addreturn['zmt']['zwmc']=$nn[1];
    $addreturn['zmt']['zmthaoyingwen']=$nn[4];
    $addreturn['zmt']['avatar']='https:'.$nn[2];
    //$addreturn['zmt']['signature']="wXtGUAAgEBCzZseXuN4Jv8F6R0AAJ8cx2SGOd0fGAOm10CkGEIeGR3uE9OAmPAaFQFeSB35ZNgQeJPo5XFctxDJiqcfYNCkAaBHeeHxo.H9g9mhIELFrCVZg6CXj532wQ9y";
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthaoyingwen']}/";
    $nr=file_get_contents($addreturn['zmt']['homeurl']);
    preg_match("/mediaId\:\s+'([0-9]+)',/Uisx",$nr,$nn);
    $media_id=$nn[1];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthaoyingwen']}/#mid={$media_id}";
    $addreturn['zmt']['datasourceurl']="https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_all&visited_uid={$addreturn['zmt']['zmthaoyingwen']}&stream_api_version=82&request_source=1&offset=0&user_id={$addreturn['zmt']['zmthaoyingwen']}&media_id={$media_id}";
    $addreturn['zmt']['addreturn']=json_encode($addreturn);
}

if(preg_match("/var\s+userInfo\s+=\s+\{\s+id\:\s+([0-9]+?)\s*\,\s*name\:\s*'(.+?)'\s*\,\s*avatarUrl\:\s*'(.+?)'.*mediaId\:\s*([0-9]+?)/Uisx",$this->ytempnr,$nn)){
    $addreturn['zmt']['zmt']="头条号";
    $addreturn['zmt']['zmthao']=$nn[2];
    $addreturn['zmt']['userid']=$nn[1];
    $addreturn['zmt']['zwmc']=$nn[2];
    $addreturn['zmt']['zmthaoyingwen']=$nn[4];
    $addreturn['zmt']['avatar']='https:'.$nn[3];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthao']}/";
    $nr=file_get_contents($addreturn['zmt']['homeurl']);
    preg_match("/mediaId\:\s+'([0-9]+)',/Uisx",$nr,$nn);
    $media_id=$nn[1];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['zmthao']}/#mid={$media_id}";
    $addreturn['zmt']['datasourceurl']="https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_all&visited_uid={$addreturn['zmt']['zmthao']}&stream_api_version=82&request_source=1&offset=0&user_id={$addreturn['zmt']['zmthao']}&media_id={$media_id}";
    $addreturn['zmt']['addreturn']=json_encode($addreturn);
}

//访问一下http://collect2.longsunhd.com/collect/index.php?gather_type=1&bug=1&api=1&ubb=0&s_url=https://www.toutiao.com/a1660948651411463/ 才能刷新哦
if(preg_match("/ugcInfo\:\s+\{\s+avatarUrl\:\s+'([^<>]*)'\,\s+userId\:\s+([^<>]*)\,\s+name\:\s+'([^<>]*)'\,/Uisx",$this->ytempnr,$nn)){
    $addreturn['zmt']['zmt']="头条号";
    $addreturn['zmt']['zmthao']=$nn[3];
    $addreturn['zmt']['userid']=$nn[2];
    $addreturn['zmt']['zwmc']=$nn[3];
    $addreturn['zmt']['zmthaoyingwen']=$nn[2];
    $addreturn['zmt']['avatar']='https:'.$nn[1];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['userid']}/";
    $nr=file_get_contents($addreturn['zmt']['homeurl']);
    preg_match("/mediaId\:\s+'([0-9]+)',/Uisx",$nr,$nn);
    $media_id=$nn[1];
    $addreturn['zmt']['homeurl']="https://www.toutiao.com/c/user/{$addreturn['zmt']['userid']}/#mid={$media_id}";
    $addreturn['zmt']['datasourceurl']="https://profile.zjurl.cn/api/feed/profile/v1/?category=profile_all&visited_uid={$addreturn['zmt']['userid']}&stream_api_version=82&request_source=1&offset=0&user_id={$addreturn['zmt']['userid']}&media_id={$media_id}";
    $addreturn['zmt']['addreturn']=json_encode($addreturn);
}
